from wsgi import app, db
from models.User import User

if __name__ == '__main__':
    with app.app_context():
        # create_all 通过找应用的依赖 或者当前文件的依赖 去创建表
        db.create_all()

        # User表数据
        db.session.add(User(ID="1", LOGINNAME="admin", PWD="123456", NAME="夏红林", SEX="1", AGE="32", EMAIL="xiahl0916@163.com", PHONENUMBER="16675138707"))
        db.session.commit()

        users = db.session.execute(db.select(User)).scalars()

        print(users)